<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <title>访问授权</title>
    <meta name="renderer" content="webkit">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
    <link rel="stylesheet" href="__PUBLIC__/css/layui.css"  media="all">
    <link rel="stylesheet" href="__PUBLIC__/css/public.css"  media="all">
</head>
<body>
<div class="layui-conter">
    <div class="layui-col-md12">
        <div class="navigation">
            <span>权限管理></span><span>访问授权</span>
        </div>
        <div class="white-conter selsectSet">
            <div class="title-blue"><b>访问授权</b></div>
            <div style="margin-top: 20px">
                <form class="layui-form" action="{:U('Power/add')}" method="post">
                    <div class="layui-col-md6">
											<div class="layui-form-item">
												<div class="label-div">
													<label class="form-label">权限名称</label>
												</div>
												<div class="layui-input-inline">
													<input type="text" name="title" id="title" autocomplete="off" placeholder="请输入..." class="layui-input">
												</div>
											</div>
												<volist name="menu_data" id="val">
                        <div class="layui-col-md10" style="margin-bottom: 20px;">
                            <div class="layui-form-item" pane="">
                                <div class="layui-input-block clsH3 "  style="position: relative;" >
                                    <input type="checkbox" name="content[]"  value="{$val.id}" lay-skin="primary" lay-filter="allChoose">
                                    <h3 style="display: inline;margin-left: 10px;">{$val.name}</h3>
                                </div>                            
                                <div class="layui-input-block" style="margin-left: 200px;">
																<foreach name="val['son']" item="vo">
                                    <input type="checkbox" name="content[]" value="{$vo.id}" lay-skin="primary" title="{$vo.name}">
																</foreach>
                                </div>
                            </div>
                        </div>													
												</volist>
                    </div>
                    <div class="layui-col-md12" style="padding-top: 25px">
                        <div class="button-block">
                            <button class="layui-btn layui-btn-xs layui-btn-normal" lay-submit="" >提交</button>
                        </div>
                    </div>
                </form>
            </div>
        </div>

    </div>

</div>




<script src="__PUBLIC__/js/layui.all.js" charset="utf-8"></script>
<!-- 注意：如果你直接复制所有代码到本地，上述js路径需要改成你本地的 -->
<script>
    layui.use(['form', 'layedit', 'laydate'], function(){
        var form = layui.form
            ,layer = layui.layer
            , $ = layui.jquery
            ,layedit = layui.layedit
            ,laydate = layui.laydate;
            

        //全选
		form.on('checkbox(allChoose)', function(data){
            var child = $(data.elem).parents(".layui-col-md10").find('input[type="checkbox"]');
		    child.each(function(index, item){
		      item.checked = data.elem.checked;
		    });
		    form.render('checkbox');
		});
    });
   
function check_form() {
	var titel = $('#title').val();
	if($.trim(titel) == '') {
		alert('请填写管理权限名称');
		return false;
	}
}
</script>

</body>
</html>